package com.website.controler;

import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;
import java.util.HashMap;
import java.util.Map;

/**
 * 模块初始化 时
 * 把富文本编辑器上传文件保存位置的配置map放到servletContext中
 * @author zsw
 *
 */
public class InitUEditor implements ServletContextAware {

	@Override
	public void setServletContext(ServletContext servletContext) {
		if(servletContext != null){
			String ueditor_customKey = "customKey"; //customKey
			String ueditor_file_path = "/baidu_ueditor/{id}"; //customPath
			Map<String,Object> ueditor_customMap = new HashMap<String, Object>();
			ueditor_customMap.put(ueditor_customKey, ueditor_file_path);

			servletContext.setAttribute("customMap", ueditor_customMap);
		}
	}
}